import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from "typeorm";
import { Employee } from "./Employee";

@Entity()
export class Department {
	@PrimaryGeneratedColumn()
	id: number;

	@Column({
		length: 50,
	})
	name: string;

    // 
    @OneToMany(()=>Employee , (employee) => employee.department,{
        cascade:true // 两边联级自动保存开启一边就好
    })
    employee_list:Employee[]

}
